<!DOCTYPE html>
<html>
	<head>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta charset="UTF-8">

		<link rel="stylesheet" href="../../css/mui.min.css">
		<script src="../../js/global.js"></script>
		<script src="../../js/mui.min.js"></script>
		<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=oj64LwtVsuHuY7eXFX1ChVQRfZPk8rkS"></script>
	</head>
	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">灾害预报</h1>
		</header>
		<div class="mui-content">
			<div style="width: 100%;position: absolute;height: 100%;" id="allMap"></div>
		</div>
		<script src="map.js"></script>
		<script>
			// 百度地图API功能
			var map = new BMap.Map("allMap");    // 创建Map实例
			map.centerAndZoom(new BMap.Point(106.8315590000, 26.7147140000), 12);  // 初始化地图,设置中心点坐标和地图级别
			var centerLng=106.7568350000,centerLat=26.5460210000,zoom=11.5;
			var modeArr=['凝冻', '大雾/KM', '暴雨/mm'];	//, '暴雪'
			var mMode=1;
			var mHour=0;
			
			mui.plusReady(function(){
				// 创建控件
				var myZoomCtrl = new ZoomControl();
				// 添加到地图当中
				map.addControl(myZoomCtrl);	
				
				var leftHour = new ChangeHourControl('left',20,60,'<上一小时',function(){
					mHour--;
					var d=new Date().getTime();
					var newD=new Date(d+mHour*3600000);
					mui.toast('当前时间：'+(newD.getYear()+1900)+'年'+(newD.getMonth()+1)+'月'+newD.getDate()+'日 '+newD.getHours()+':00:00');
					loadData();
				});
				var leftSixHour = new ChangeHourControl('left',20,100,'<上六小时',function(){
					mHour-=6;
					var d=new Date().getTime();
					var newD=new Date(d+mHour*3600000);
					mui.toast('当前时间：'+(newD.getYear()+1900)+'年'+(newD.getMonth()+1)+'月'+newD.getDate()+'日 '+newD.getHours()+':00:00');
					loadData();
				});
				var rightSixHour = new ChangeHourControl('right',20,100,'下六小时>',function(){
					mHour+=6;
					var d=new Date().getTime();
					var newD=new Date(d+mHour*3600000);
					mui.toast('当前时间：'+(newD.getYear()+1900)+'年'+(newD.getMonth()+1)+'月'+newD.getDate()+'日 '+newD.getHours()+':00:00');
					loadData();
				});
				var rightHour = new ChangeHourControl('right',20,60,'下一小时>',function(){
					mHour++;
					var d=new Date().getTime();
					var newD=new Date(d+mHour*3600000);
					mui.toast('当前时间：'+(newD.getYear()+1900)+'年'+(newD.getMonth()+1)+'月'+newD.getDate()+'日 '+newD.getHours()+':00:00');
					loadData();
				});
				map.addControl(leftHour);	
				map.addControl(leftSixHour);	
				map.addControl(rightSixHour);	
				map.addControl(rightHour);	
				loadData();
			});
			
		</script>
	</body>
</html>
